home *** CD-ROM | disk | FTP | other *** search
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
- From: grantp@usa.pipeline.com(Pete Grant)
- Newsgroups: comp.lang.c++
- Subject: Re: Operator overload problem!
- Date: 20 Mar 1996 01:22:15 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4inmk7$9ac@news1.h1.usa.pipeline.com>
- References: <DoIn1z.Gou@latcs1.lat.oz.au>
- NNTP-Posting-Host: 38.8.53.2
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete Grant)
- X-Newsreader: Pipeline v3.5.0
-
- On Mar 19, 1996 13:05:58 in article <Operator overload problem!>,
- 'boylesgj@lion.cs.latrobe.edu.au (Gregary J Boyles)' wrote:
-
-
- >I am trying to overload the << but I get the syntax errors : friends must
- be
- >functions or
- >classes, 'ostream' cannot start a parameter declaration,
- 'Address::operator
- ><<(int &,Address &)'
- >must be declared at the first set of astericks and declaration syntax
- error at
- >the second set.
- >
- >What the #$%& is it on about? I copied the operator overload function
- directly
- >out of a program
- >which compiles and runs so why all of a sudden won't the bloody compiler
- accept
- >it?
- > [... code deleted ...]
-
- You need to #include <iostream.h> so that the compiler knows
- what ostream is.
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-